package com.ruoyi.lxzx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lxzx.mapper.UserPayRecordMapper;
import com.ruoyi.lxzx.domain.UserPayRecord;
import com.ruoyi.lxzx.service.IUserPayRecordService;

/**
 * 用户付款记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-26
 */
@Service
public class UserPayRecordServiceImpl implements IUserPayRecordService 
{
    @Autowired
    private UserPayRecordMapper userPayRecordMapper;

    /**
     * 查询用户付款记录
     * 
     * @param id 用户付款记录主键
     * @return 用户付款记录
     */
    @Override
    public UserPayRecord selectUserPayRecordById(Long id)
    {
        return userPayRecordMapper.selectUserPayRecordById(id);
    }

    /**
     * 查询用户付款记录列表
     * 
     * @param userPayRecord 用户付款记录
     * @return 用户付款记录
     */
    @Override
    public List<UserPayRecord> selectUserPayRecordList(UserPayRecord userPayRecord)
    {
        return userPayRecordMapper.selectUserPayRecordList(userPayRecord);
    }

    /**
     * 新增用户付款记录
     * 
     * @param userPayRecord 用户付款记录
     * @return 结果
     */
    @Override
    public int insertUserPayRecord(UserPayRecord userPayRecord)
    {
        userPayRecord.setCreateTime(DateUtils.getNowDate());
        return userPayRecordMapper.insertUserPayRecord(userPayRecord);
    }

    /**
     * 修改用户付款记录
     * 
     * @param userPayRecord 用户付款记录
     * @return 结果
     */
    @Override
    public int updateUserPayRecord(UserPayRecord userPayRecord)
    {
        userPayRecord.setUpdateTime(DateUtils.getNowDate());
        return userPayRecordMapper.updateUserPayRecord(userPayRecord);
    }

    /**
     * 批量删除用户付款记录
     * 
     * @param ids 需要删除的用户付款记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPayRecordByIds(Long[] ids)
    {
        return userPayRecordMapper.deleteUserPayRecordByIds(ids);
    }

    /**
     * 删除用户付款记录信息
     * 
     * @param id 用户付款记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPayRecordById(Long id)
    {
        return userPayRecordMapper.deleteUserPayRecordById(id);
    }
}
